package com.kk.framework.util;

import java.text.SimpleDateFormat;
import java.util.Calendar;

public class DateUtils
{
    /**   
     * 得到本月的第一天   
     * @return   
     */    
    public static String getMonthFirstDay() 
    {     
        Calendar calendar = Calendar.getInstance();     
        calendar.set(Calendar.DAY_OF_MONTH, calendar.getActualMinimum(Calendar.DAY_OF_MONTH));        
        SimpleDateFormat df = new SimpleDateFormat("MM-dd");
        return df.format(calendar.getTime());     
    }     
        
    /**   
     * 得到本月的最后一天   
     *    
    . * @return   
     */    
    public static String getMonthLastDay() 
    {     
        Calendar calendar = Calendar.getInstance(); 
        calendar.set(Calendar.DAY_OF_MONTH, calendar.getActualMaximum(Calendar.DAY_OF_MONTH));     
        SimpleDateFormat df = new SimpleDateFormat("MM-dd");
        return df.format(calendar.getTime());      
    } 
    
    public static String getCurrentYear()
    {
        Calendar calendar = Calendar.getInstance();
        SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd");
        return df.format(calendar.getTime());      
    }
    
    public static String getChineseWeekDayStr(int weekDay)
    {
    	switch(weekDay)
    	{
    		case 1:
    			return "星期一";
    		case 2:
    			return "星期二";
    		case 3:
    			return "星期三";
    		case 4:
    			return "星期四";
    		case 5:
    			return "星期五";
    		case 6:
    			return "星期六";
    		case 7:
    			return "星期日";
    	}
    	
    	return "";
    }
}
